#include <stdio.h>

int myStrcmp1(const char * s1, const char * s2)
{
    while (*s1 == *s2 && *s1 != '\0')
    {
        s1++;
        s2++;
    }
    return *s1 - *s2;
}

int myStrcmp2(const char * s1, const char * s2)
{
    int idx = 0;
    while (s1[idx] == s2[idx] && s1[idx] != '\0')
    {
        idx++;
    }
    return s1[idx] - s2[idx];
}

int main()
{
    char s1[] = "cpples";
    char s2[] = "apple";
    printf("%d", myStrcmp2(s1, s2));

    return 0;
}